package com.candy.convert.model;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Objects;

@Data
public class ConverterKey<S, T> {

    private Class<S> sourceType;
    private Class<T> targetType;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ConverterKey<?, ?> that = (ConverterKey<?, ?>) o;
        return Objects.equals(sourceType, that.sourceType) &&
                Objects.equals(targetType, that.targetType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(sourceType, targetType);
    }
}
